home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Utils / GParted Live CD / Bin / gparted-livecd-0.2.2.iso / fake / needwrite / etc / rc.d / init.d / sendsignals < prev    next >
Encoding:
Text File  |  2006-01-27  |  969 b   |  52 lines

  1. #!/bin/sh
  2. # Begin $rc_base/init.d/sendsignals - Sendsignals Script
  3.  
  4. # Based on sendsignals script from LFS-3.1 and earlier.
  5. # Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
  6.  
  7. . /etc/sysconfig/rc
  8. . $rc_functions
  9.  
  10. case "$1" in
  11.     stop)
  12.         echo -e -n '\E[32mSending all processes the TERM signal'
  13.         killall5 -15
  14.         error_value=$?
  15.  
  16.         sleep $KILLDELAY
  17.  
  18.         if [ "$error_value" = 0 ]
  19.         then
  20.             echo -n -e '\E[31m Success'
  21.                         echo ""
  22.         else
  23.                     echo -n -e '\E[31m Failure'
  24.                         echo ""
  25.         fi
  26.  
  27.         echo -e -n '\E[32mSending all processes the KILL signal'
  28.         killall5 -9
  29.         error_value=$?
  30.  
  31.         sleep $KILLDELAY
  32.  
  33.         if [ "$error_value" = 0 ]
  34.         then
  35.             echo -n -e '\E[31m Success'
  36.                         echo ""
  37.         else
  38.                     echo -n -e '\E[31m Failure'
  39.                         echo ""
  40.         fi
  41.         ;;
  42.  
  43.     *)
  44.         echo -e -n "\E[32mUsage: $0 {stop}"
  45.                 echo ""
  46.         exit 1
  47.         ;;
  48.  
  49. esac
  50.  
  51. # End $rc_base/init.d/sendsignals
  52.